<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
  <style type="text/css">
  /* tooltip */
  #tooltip{
    position:absolute;
    border:1px solid #ccc;
    background:#333;
    padding:2px;
    display:none;
    color:#fff;
  }
.layui-table th{text-align:center}
  </style>
</head>
<body style="padding:10px;">

<div style="padding:10px 20px;"></div>
<div class="layui-tab">
  <ul class="layui-tab-title">
    <li class="layui-this">包子铺回迁选房汇总</li>
    <?php if(!in_array($admin_cate_id,$operation)){ ?>
    <li><a href="{:url('admin/hqjiesuan/add')}" class="a_menu">新增</a></li>
    <?php } ?>
  </ul>
</div>
<h2 id="" style="text-align:center">包子铺回迁选房汇总</h2>
    <table class="layui-table" lay-size="lg">
      <thead>
        <tr>
          <th align="center">序号</th>
          <th align="center">拆迁编号</th>
          <th align="center">评估编号</th>
          <th align="center">户主姓名</th>
          <th align="center">选房房号</th>
          <th align="center">面积（平米）</th>
          <th align="center">类型</th>
          <th align="center">备注</th>
          <?php if(!in_array($admin_cate_id,$operation)){ ?>
          <th align="center">操作</th>
          <?php } ?>
        </tr> 
      </thead>
      <tbody>
        {volist name="list" id="vo"}
        <tr>
          <td align="center">{$vo.id}</td>
          <td align="center">{$vo.chainum}</td>
          <td align="center">{$vo.pingnum}</td>
          <!--<td align="center"><a href="{:url('admin/hqjiesuan/hqjiesuan_add',['id'=>$vo.id])}" style="color:blue;text-align:center;display:block">{$vo.name}</a></td>-->
                  <td align="center">{$vo.name}</td>
          <td align="center">{$vo.fh}</td>
          <td align="center">{$vo.mj}</td>
          <td align="center">{$vo.lx}</td>
          <td align="center">{$vo.bz}</td>
          <?php if(!in_array($admin_cate_id,$operation)){ ?>
          <td>
            <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
            <a onclick="edit('{$vo.id}')" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>

          </td>
          <?php } ?>
        </tr>
        {/volist}
      </tbody>
    </table>
    <div style="padding:0 20px;"></div> 
    {include file="public/foot"}

  
</body>
</html>

<script>
  $('.delete').click(function(){
    var id = $(this).attr('id');
    layer.confirm('确定要删除?', function(index) {
      $.ajax({
        url:"{:url('admin/hqjiesuan/delete')}",
        data:{id:id},
        success:function(res) {
          if(res.code == 1) {
            layer.msg(res.msg);
            setTimeout(function(){
              location.reload();
            },1500)

          }else{
            layer.msg(res.msg,{icon:1,time:3000});
          }
        }
      })
    })
  })

  function edit(id){
    layer.open({
      type: 2,
      area: [600+'px', 600 +'px'],
      fix: false, //不固定
      maxmin: true,
      shadeClose: true,
      title: "编辑",
      content: "/admin/hqjiesuan/edit.shtml?id=+"+id
    })
  }
  </script>